<template>
    <div>
        <el-row class="mb20">
            <el-col :span="24">
                <el-button type="primary" @click="dialogVisible = true">高级查询</el-button>
            </el-col>
            <el-dialog title="高级查询" :visible.sync="dialogVisible" width="40%">
                <el-form :model="ruleForm" ref="ruleForm" label-width="150px" class="demo-ruleForm">
                    <el-form-item label="订单种类：">
                        <el-select v-model="ruleForm.type" filterable placeholder="请选择" class="w100">
                            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="日期：" class="w100">
                        <div class="block">
                            <el-date-picker
                            v-model="ruleForm.value"
                            type="month"
                            placeholder="选择月">
                            </el-date-picker>
                        </div>
                    </el-form-item>
                </el-form>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="resetForm('ruleForm')">取 消</el-button>
                    <el-button type="primary" @click="submitForm('ruleForm')">查询</el-button>
                </span>
            </el-dialog>
        </el-row>
        <el-table :data="tableData" stripe border>
            <el-table-column label="日期" width="250">
                <template slot-scope="scope">
                    <span class="link" @click="getDetail(scope.row)">{{ scope.row.date}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="type" label="订单种类" width="200">
            </el-table-column>
            <el-table-column prop="method" label="操作员" width="200">
            </el-table-column>
            <el-table-column prop="num" label="卡号数量" width="200">
            </el-table-column>
            <el-table-column prop="all_price" label="总金额">
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                tableData: [
                    {
                        id: 1,
                        date: '2018-05-29 14:42:20',
                        type: '执行手动续期',
                        method: '苏州金龙',
                        num: 2,
                        all_price: '0.0'
                    }
                ],
                ruleForm: {
                    type: '',
                    value: ''
                },
                options: [
                    {
                        value: '选线1',
                        label: '自动续期'
                    },
                    {
                        value: '选线2',
                        label: '手动续期'
                    }
                ],
                dialogVisible: false
            }
        },
        methods: {
            getDetail(goods) {
                this.$router.push({
                    path: `/agent_increase/${this.$route.params.id9}/agent_order_statistics/${goods.id}`
                })
            }
        }
    }
</script>

<style scoped lang="scss">
    .w100, .el-date-editor.el-input {
        width: 100%;
    }
</style>